/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-01-12 09:35:49
 * @LastEditTime : 2023-05-06 10:39:43
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Pages\Front\Common\LargeScreen\LargeScreenModal.jsx
 * @Description  :
 */
import { CommonSmallTitle, CommonSmallTitleTwo } from '../Other/SmallTitle'
import { Modal } from 'antd'
import { LargeScreeTable } from './TablePage'
import { Article, IframeBox } from './Article'
import {
    TensioningModal,
    GroutingModal,
    JSZXOutline,
    JSZXIframe,
    TestDetailed,
    BadaPaymentFinalSummaryList,
} from './DiyModal'

const TypeList = {
    LargeScreeTable,
    Article,
    TensioningModal,
    GroutingModal,
    IframeBox,
    JSZXOutline,
    JSZXIframe,
    TestDetailed,
    BadaPaymentFinalSummaryList,
}

export const LargeScreenTablesModal = ({ Off, className, title, parameter, ExperimentalThrEvent, testData }) => {
    return (
        <Modal
            className="LargeScreenTablesModal"
            open={true}
            onCancel={Off}
            footer={null}
            destroyOnClose={true}
            width="80vw"
            keyboard={false}
            maskClosable={false}
        >
            {parameter?.top === 'two' ? (
                <CommonSmallTitleTwo className={`${className} TwoModal`} title={title} flex={1}>
                    {(() => {
                        const { uuid, type, classification, other } = parameter
                        const Template = TypeList[type]
                        return (
                            <Template
                                uuid={uuid}
                                className={className}
                                classification={classification}
                                ExperimentalThrEvent={ExperimentalThrEvent}
                                testData={testData}
                                other={other}
                                Off={Off}
                            />
                        )
                    })()}
                </CommonSmallTitleTwo>
            ) : (
                <CommonSmallTitle className={`${className} TwoModal`} title={title} flex={1}>
                    {(() => {
                        const { uuid, type, classification, other } = parameter
                        const Template = TypeList[type]
                        return (
                            <Template
                                uuid={uuid}
                                className={className}
                                classification={classification}
                                ExperimentalThrEvent={ExperimentalThrEvent}
                                testData={testData}
                                other={other}
                                Off={Off}
                            />
                        )
                    })()}
                </CommonSmallTitle>
            )}
        </Modal>
    )
}

export const NotTitleLargeScreenTablesModal = ({ className, parameter, ExperimentalThrEvent, testData }) => {
    const { uuid, type, classification, other } = parameter
    const Template = TypeList[type]
    return (
        <Template
            uuid={uuid}
            className={className}
            classification={classification}
            ExperimentalThrEvent={ExperimentalThrEvent}
            testData={testData}
            other={other}
        />
    )
}
